package org.dingfugui.triple.link;

import org.dingfugui.triple.connection.ConnectionFactory;

import java.net.InetSocketAddress;

/**
 * 直连
 *
 * @author fugui.ding at 2015/6/12
 */
public abstract class AbstractLink implements Link {
    protected ConnectionFactory factory;
    protected InetSocketAddress address;

    public AbstractLink(String host, ConnectionFactory factory) {
        this.address = new InetSocketAddress(host, DEFAULT_PORT);
        this.factory = factory;
    }

    public AbstractLink(String host, int port, ConnectionFactory factory) {
        this.address = new InetSocketAddress(host, port);
        this.factory = factory;
    }

    public AbstractLink(InetSocketAddress address, ConnectionFactory factory) {
        this.address = address;
        this.factory = factory;
    }

}
